﻿using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
using TConvert = System.Convert;
using System.Collections;
using System.Text.RegularExpressions;

namespace DBA.Common
{
    public class SHA256 : DEncryptBase
    {
        public override string Encode(string encryptString)
        {
            byte[] SHA256Data = Encoding.UTF8.GetBytes(encryptString);
            SHA256Managed Sha256 = new SHA256Managed();
            byte[] Result = Sha256.ComputeHash(SHA256Data);
            return TConvert.ToBase64String(Result);  //返回长度为44字节的字符串
        }

        public override string Decode(string decryptString)
        {
            throw new NotImplementedException();
        }
    }
}
